﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RouletteGame
{
    public class Roulette : IRoulette
    {
        private List<Field> _fields;
        private Field _result;
        private IRandom _random;

        public Roulette(IFactory factory, IRandom random)
        {
            _fields = factory.createFields();
            _random = random;
            _result = _fields[0];
        }

        public void Spin()
        {
            _result = _fields[(int)_random.GetRandom()];
        }

        public Field GetResult()
        {
            return _result;
        }

    }
}
